home *** CD-ROM | disk | FTP | other *** search
- ' Caption: Converts Text to PDF|
- ' Hint: Converts active document to PDF|
- ' Icon: <The Icon from the Menuitem>|
-
- option explicit
-
- ' Remove the dot to include this files
- '#.include <consts>
- '#include <cmnfunc>
-
- const mpdf = "C:\win\lcc\projects\my\mpdf\lcc\mpdf.exe"
-
- sub Main(dummy)
- if Documents.Count = 0 then
- exit sub
- end if
- dim txt, pdf, cmd
- txt = ActiveDocument.FileName
- pdf = ChangeFileExt(txt, ".pdf")
- if FileExists(txt) then
- cmd = AddQuotesUnless(mpdf) & " -t -m fscrn -p letter -l single " & _
- AddQuotesUnless(txt) & " " & AddQuotesUnless(pdf)
- ' Exec mpdf, "-t -m fscrn -p letter -l single " & _
- ' AddQuotes(txt) & " " & AddQuotes(pdf), ActiveDocument.FilePath, true
- Execute cmd, 1, true
- end if
- end sub
-